package com.em.tuppence.web.security.openid;

import java.util.Arrays;
import java.util.List;

import org.springframework.security.openid.AxFetchListFactory;
import org.springframework.security.openid.OpenIDAttribute;

public class TuppenceAxFetchListFactory implements AxFetchListFactory {

	private final List<OpenIDAttribute> attributeList;
	
	public TuppenceAxFetchListFactory() {
		this.attributeList = Arrays.asList(UsedOpenIDAttribute.FIRST_NAME.getOpenIdAttribute(), 
                UsedOpenIDAttribute.LAST_NAME.getOpenIdAttribute(), 
                UsedOpenIDAttribute.EMAIL.getOpenIdAttribute(),
                UsedOpenIDAttribute.AX_FIRST_NAME.getOpenIdAttribute(),
                UsedOpenIDAttribute.AX_LAST_NAME.getOpenIdAttribute(),
                UsedOpenIDAttribute.NAME_PERSON.getOpenIdAttribute());
	}
	
	@Override
	public List<OpenIDAttribute> createAttributeList(String identifier) {
		return attributeList;
	}

}
